export const transFormValue = (obj) => {
    let arr = [];
    Object.keys(obj).forEach(function(key){
      if(typeof obj[key] == 'object' ){
        if(obj[key] == null){
          arr.push(`${key}=`)
        }else{
          if(obj[key]=='object'){
            obj[key] = obj[key].map(item=>JSON.stringify(item)).join(',')
          }
          arr.push(`${key}=${JSON.stringify(obj[key])}`)
        }
      }else{
        arr.push(`${key}=${obj[key]}`)
      }
    });
    return '?'+arr.join('&')
}

export const transfromData = (arr, value)=>{
    let data = arr.filter(item=>item.value==value)
    if(data.length>0){
        return data[0].label
    }
    return ''
}